<?php

namespace Controller\Dog;

class PhotoDetail extends Base {

	public function actionIndex() {
		$this->setCurrentMenuKey('Blind');
		$params = $this->getRouteParams();
		$photoId = !empty($params[0]) ? (int) $params[0] : 0;
		if (!$photoId) {
			$this->throwException('参数错误');
		}
		$detail = \Business\User::instance()->getPhotoDetailByPhotoId($photoId);
		if (!$detail) {
			$this->throwException('图片不存在');
		}
		$userInfo = $this->getUserDetailInfo($detail['UserId']);
		$userPhotos = \Business\User::instance()->getUserPhotosByUserId($detail['UserId'], 20);
		$this->assign('userPhotos', $userPhotos);
		$this->assign('detail', $detail);
		$this->display();
	}
}